/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.mer.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaaction.common.service.TreeService;
import com.kaaction.common.utils.StringUtils;
import com.kaaction.modules.mer.entity.CustomerSource;
import com.kaaction.modules.mer.dao.CustomerSourceDao;

/**
 * 客户来源Service
 * @author huanghaiming
 * @version 2017-05-16
 */
@Service
@Transactional(readOnly = true)
public class CustomerSourceService extends TreeService<CustomerSourceDao, CustomerSource> {

	public CustomerSource get(String id) {
		return super.get(id);
	}
	
	public List<CustomerSource> findList(CustomerSource customerSource) {
		if (StringUtils.isNotBlank(customerSource.getParentIds())){
			customerSource.setParentIds(","+customerSource.getParentIds()+",");
		}
		return super.findList(customerSource);
	}
	
	@Transactional(readOnly = false)
	public void save(CustomerSource customerSource) {
		super.save(customerSource);
	}
	
	@Transactional(readOnly = false)
	public void delete(CustomerSource customerSource) {
		super.delete(customerSource);
	}
	
}